<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="util.js"></script>
</head>
<body>
    <span id="show"></span>
    <span id="show1"></span>
    <script > 
        //倒计时 
        setInterval(function(){
            var time1=new Date();
            timeDifferent(time1,time2,function(value){
                show.innerHTML="和双11相差"+value.days+"天"+value.hours+"小时"+value.minutes+"分"+value.seconds+"秒";
            })
            
        },1000)
        
        var time2=new Date("2020-11-11 00:00:00");
        // 在页面停留时间
        setInterval(function(){
            var time1=new Date();
            timeDifferent(time1,time3,function(value){
                show1.innerHTML="在页面停留了"+value.days+"天"+value.hours+"小时"+value.minutes+"分"+value.seconds+"秒";
            })
            
        },1000)
        
        var time3=new Date();
    </script>
</body>
</html>